package dome1;

import java.util.Arrays;

public class MyStack {
    public int[] elem;
    public int usedSize;
    public MyStack() {
        elem = new int[10];
    }
    public void push(int val) {
        if(isFull()) {
            elem = Arrays.copyOf(elem,elem.length*2);
        }
        elem[usedSize] = val;
        usedSize++;
    }
    private boolean isFull() {
        return elem.length == usedSize;
    }
}
